<?php
namespace Home\Controller;
use Think\Controller;
class ClubsController extends Controller {
     public function clublist(){//俱乐部列表-赵明月
        $admin=M('admins');
        $admins=$admin->find();
        $this->admin=$admins;

		$clubs=M('club');
    $qrcodenum=$clubs->count();
    $Page = new \Think\Page($qrcodenum,5);
    $Page->setConfig('header', '共<b>%TOTAL_ROW%</b>条记录&nbsp;&nbsp;
每页<b>5</b>条&nbsp;&nbsp;第<b>%NOW_PAGE%</b>页/共<b>%TOTAL_PAGE%</b>页');
    $Page->setConfig('prev','上一页');
    $Page->setConfig('next','下一页');
    $Page->setConfig('last','末页');
    $Page->setConfig('first','首页');
    $Page->setConfig('theme',' %FIRST% %UP_PAGE% %LINK_PAGE% %DOWN_PAGE% %END% %HEADER%');
    $this->pageNav=$Page->show();//在页面{pageNav}
        //$this->link=$Page->show();
    $this->qrcodeList=$clubs->limit($Page->firstRow,5)->order('cid asc')->select();
    $this->display();

    //$clubs=$clubs->order('cid desc')->select();
        //dump($clubs);
        //$this->clubs=$clubs;*/
        //$this->display();
    }
  
   
 
 public function detail($cid){//俱乐部详情-赵明月
        $admin=M('admins');
        $admins=$admin->find();
        $this->admin=$admins;
        
       $clubs=M('club');//实例化一个model对象
        $res=$clubs->where("cid = $cid")->select();//asc升序 desc降序
        $this->detail=$res;
        //dump($this->detail);
        $this->display();

 }
 
}